package cn.mjj;

/**
 * @author Mxb
 * @version 1.0
 * @date 2020/5/10 17:43
 */
public class Main {
    public static void main(String[] args) {
        //1，创建工厂对象
        ShapeFactory shapeFactory = new ShapeFactory();
        //获取 circle对象，并调用它的方法
        Shape circle = shapeFactory.getShape("circle");
        circle.draw();

        //获取 rectangle，并调用它的方法
        Shape rectangle = shapeFactory.getShape("rectangle");
        rectangle.draw();

        //获取 square，并调用它的方法
        Shape square = shapeFactory.getShape("square");
        square.draw();
    }
}
